
/**
* @Title: PictureController.java
* @Package com.leetone.controller
* @Description: 【】
* @date 2018年3月14日 下午7:34:07
* @version V1.0
* @Company: 上海
* @author:[谭磊][leetone123@163.com]
*/

package com.leetone.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.leetone.service.PictureService;
import com.leetone.utils.JsonUtils;

/**
* @ClassName: PictureController
* @Description: 【图片上传】
* @date 2018年3月14日 下午7:34:07
* @Company: 上海
* @author:[谭磊][leetone123@163.com]
*/
@Controller
public class PictureController {
	@Autowired
	private PictureService pictureService;
	@RequestMapping("/pic/upload")
	@ResponseBody
	public String upload(MultipartFile uploadFile)
	{
		Map resultMap = pictureService.uploadPicture(uploadFile);
		//为了保持浏览器的兼容性，返回一个转换好的JSON字符串
		return JsonUtils.objectToJson(resultMap);
	}
}
